﻿using System;

namespace NeuralLib
{
    public class KohonenMetricFunction1:IKohonenMetricFunction
    {
        public double Function(double[] x, double[] w)
        {
            double sum = 0;
            var len = x.Length;
            for (var i = 0; i < len; i++)
                sum += Math.Pow(x[i] - w[i], 2);
            return  Math.Exp(-Math.Sqrt(sum));
        }

    }
}
